package com.heima.service.impl;

import com.heima.pojo.TbTask;
import com.heima.mapper.TbTaskMapper;
import com.heima.pojo.vo.TaskReportInfoVo;
import com.heima.service.ITbTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.util.LocalDateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 工单表 服务实现类
 * </p>
 *
 * @author nan
 * @since 2024-06-12
 */
@Service
public class TbTaskServiceImpl extends ServiceImpl<TbTaskMapper, TbTask> implements ITbTaskService {

    @Autowired
    private TbTaskMapper taskMapper;

    /**
     * 工单统计
     *
     * @param start
     * @param end
     * @return
     */
    @Override
    public List<TaskReportInfoVo> taskReportInfo(String start, String end) {
        LocalDate startTime = LocalDateUtil.parse(start);
        LocalDate endTime = LocalDateUtil.parse(end);
        return taskMapper.taskReportInfo(startTime,endTime);
    }
}
